import myAxios from "./myAxios";
import { BASE_URL } from "../config";

export const login = (username, password) => {
  return myAxios.post(`${BASE_URL}/login`, { username, password });
};
export const getCategoryListApi = () => {
  return myAxios.get(`${BASE_URL}/manage/category/list`);
};
export const addCategoryApi = (categoryName) => {
  return myAxios.post(`${BASE_URL}/manage/category/add`, { categoryName });
};

export const productListApi = (pageNum, pageSize) => {
  return myAxios.get(`${BASE_URL}/manage/product/list`, {
    params: { pageNum, pageSize },
  });
};
